#include<iostream>
using namespace std;
typedef long long LL;
const int N = 1010;
LL p[N];
LL arr[N];
int n, k;
int main()
{
	cin >> n >> k;
	for (int i = 1; i <= n; i++) {
		cin >> arr[i];
	}
	bool flag = 0;
	for (int i = 2; i <= n; i++) {
		if (arr[i] - arr[i - 1] != k) {
			flag = 1;
		}
	}
	if (!flag) {
		cout << 0 << endl;
		return 0;
	}
	int ans = 0;
	int idx = 0;
	int mi = n;
	for (int i = 1; i <= n; i++) {
		p[i] = arr[i];
		ans = 0;
		for (int j = i + 1; j <= n; j++) {
			p[j] = p[j - 1] + k;
		}
		for (int j = i - 1; j >= 1; j--) {
			p[j] = p[j + 1] - k;
		}
		for (int j = 1; j <= n; j++) {
			if (arr[j] != p[j]) {
				ans++;
			}
		}
		if (ans < mi) {
			mi = ans;
			idx = i;
		}
	}
	cout << mi << endl;
	for (int i = idx - 1; i >= 1; i--) {
		if (arr[i] == p[i]) {
			continue;
		}
		else if (arr[i] > p[i]) {
			cout << "- " << i << " " << arr[i] - p[i] << endl;
		}
		else {
			cout << "+ " << i << " " << p[i] - arr[i] << endl;
		}
	}
	for (int i = idx; i <= n; i++) {
		if (arr[i] == p[i]) {
			continue;
		}
		else if (arr[i] > p[i]) {
			cout << "- " << i << " " << arr[i] - p[i] << endl;
		}
		else {
			cout << "+ " << i << " " << p[i] - arr[i] << endl;
		}
	}
	return 0;
}